#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2021/8/27 10:47
# @Author  : 李中华
# @Email   : 1260429766@qq.com
# @File    : confInfo.py
from selenium.webdriver.common.by import By


class ConfInfo:
    """
    参数配置
    """

    ELEMENT_LOCATE_MODE = {
        'name': By.NAME,
        'id': By.ID,
        'xpath': By.XPATH,
        'link': By.LINK_TEXT,
        'partial_link': By.PARTIAL_LINK_TEXT,
        'tag': By.TAG_NAME,
        'class': By.CLASS_NAME,
        'css': By.CSS_SELECTOR
    }

    @staticmethod
    def get_element_by_mode(mode):
        return ConfInfo.ELEMENT_LOCATE_MODE[mode]


if __name__ == '__main__':
    # print(ConfInfo().get_element_locate_mode('id'))
    print(ConfInfo.get_element_by_mode('name'))
